#ifndef TEXTUREEDITOR_H
#define TEXTUREEDITOR_H

#include <QWidget>
#include <baseeditor.h>
#include <ui_textureeditor.h>
#include <materialmanager.h>
#include <material_editor/basematerialeditor.h>
#include <grouptreeitemview.h>

class TextureEditor : public BaseMaterialEditorWidget
{
  Q_OBJECT
private:
  Ui::TextureEditor   _gui;
  Texture*            _texture;

  QGraphicsScene      *_scene;
  QGraphicsPixmapItem *_pixmapItem;
  GroupTreeItemView   *_groupView;

  void TextureChanged ();

private slots:
  /**
   * \name GUI-Response
   * @{
   */
  void on_pushButtonBrowse_clicked ();
  void on_lineEditFilename_textChanged (const QString& text);
  void on_comboBoxWrap_currentIndexChanged (int index);
  void on_comboBoxFilter_currentIndexChanged (int index);
	void on_comboBoxMipMap_currentIndexChanged (int index);
  void on_comboBoxAnisotrophy_currentIndexChanged (int index);
  /**
   * @}
   */

public:
  TextureEditor(Texture* texture, QWidget *parent = 0);
  void SetTexture (Texture* texture);
  Texture* GetTexture ();

  virtual QString GetTypeName ();
  virtual QString GetUnsaveMessage ();

  
public slots:
  virtual void Save ();

  void UpdateGUI ();

signals:
  void TextureChanged (TextureEditor* editor, Texture* texture);
};

#endif // TEXTUREEDITOR_H
